package messagesvc.api.impl;

import cn.ucloud.microsf.commonlib.response.EmptyResponse;
import cn.ucloud.microsf.commonlib.response.PageListResponse;
import cn.ucloud.microsf.messagesvc.executor.subcribe.SubscribeCreateExecutor;
import cn.ucloud.microsf.messagesvc.executor.subcribe.SubscribeListExecutor;
import cn.ucloud.microsf.messagesvc.request.record.SubscribeCreateRequest;
import cn.ucloud.microsf.messagesvc.request.record.SubscribeListRequest;
import cn.ucloud.microsf.messagesvc.response.record.SubscribeListResponse;
import messagesvc.api.SubscribeController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SubscribeControllerImpl implements SubscribeController {

  @Autowired
  private SubscribeCreateExecutor subscribeCreateExecutor;
  @Autowired
  private SubscribeListExecutor subscribeListExecutor;

  @Override
  public EmptyResponse create(SubscribeCreateRequest request) {
    return subscribeCreateExecutor.execute(request);
  }

  @Override
  public PageListResponse<SubscribeListResponse> list(SubscribeListRequest request) {
    return subscribeListExecutor.execute(request);
  }
}
